package ch.simas.cdi;

import java.util.Date;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.event.Event;
import javax.inject.Inject;
import javax.inject.Named;

/**
 *
 * @author Simon
 */
@ApplicationScoped
@Named
@Traceable
public class ApplicationBean {

    @Inject
    @Standard
    SessionBean session;
    @Inject
    Event<HelloEvent> events;

    public String getHello() {
        events.fire(new HelloEvent("from bean at " + new Date().toString()));
        return "Hello, world! Session created at " + session.getCreationTimestamp();
    }
}
